def bubbling_sorted(li):
    for i in range(len(li) - 1):
        for j in range(len(li) - i - 1):
            if li[j] > li[j + 1]:
                li[j], l[j + 1] = li[j + 1], l[j]



if __name__ == '__main__':
    l = [3, 4, 1, 5, 9, 2, 7, 8, ]
    bubbling_sorted(l)
    print(l)